package com.buddy.qreport.query.converter;

import com.buddy.qreport.query.params.ParamDataSourceType;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.convert.converter.Converter;

@Configuration
public class ParamDataSourceTypeConverter implements Converter<String, ParamDataSourceType> {
    @Override
    public ParamDataSourceType convert(String s) {


        switch (s){

            case "JSON":

                return ParamDataSourceType.JSON;

            case "SQL":

                return ParamDataSourceType.SQL;
        }

        return null;
    }
}
